package com.task.quartz.task;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

import org.springframework.stereotype.Component;

/**
 * @author 迪迦.
 * @date 2024/12/27 12:12
 */
@Component
public class RunAfterSpring {

  @Resource
  TaskJobService taskJobService;

  @PostConstruct
  public void checkTableExist() {
    taskJobService.checkTableExist();
    taskJobService.initRedis();
  }

  @PostConstruct
  public void addDeptAuthentication() {
    taskJobService.addDeptAuthentication();
  }

  @PostConstruct
  public void addRelationTable() {
    new Thread(() -> {
      taskJobService.addRelationTable();
    }).start();
  }

  @PostConstruct
  public void addRelationValue() {
    new Thread(() -> {
      taskJobService.addRelationValue();
    }).start();
  }

}
